function [W] = SPS(Y,L_s)
%SPS Spatial Smoothing
%
%   Increases the amount of samples
%   for an observation matrix X at
%   the expense of array elements
%
%   Usage:
%      Z = SPS(X)
%      Z = SPS(X,L_s)   % no. of subarrays
%

if nargin < 2
    L_s = 2; % No. of subarrays
end

[M,N] = size(Y);

M_s = M - L_s + 1; % No. of sensor elements in each subarray

W = zeros(M_s,L_s*N);

for l_s = 1:L_s
    W(:,(N*(l_s-1)+1):(l_s*N)) = Y(l_s:(M_s+l_s-1),:);
end

end
